#include "HiddenSoldierState.h"

void HiddenSoldierState::initSprites() {
	_armyData->initSpriteHandler();
	_armyData->sprites->addSprite(1, _ID_ARMY_RED_HIDDEN, 0);
	_armyData->sprites->setState(1);
}

void HiddenSoldierState::updateCurrentSprite() {
	_counter = _counter > 149 ? 0 : _counter + 1;
	_armyData->sprites->currentSprite->setIndex(_currentStateIndex);
}

void HiddenSoldierState::update(long timetick) {
	if(_armyData->deaded == true)
	{
		return;
	}
	if (_armyData->isDead)
	{
		_armyData->deaded = true;
		_armyData->canInteract = false;
		EffectManager::getInstatnse()->createEffect(EffectType::TYPE_Object_Burning, _armyData->getRect()->X, _armyData->getRect()->Y);
	}
	RedGunState::update(timetick);
}